package com.work.straighttalk.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;

import com.work.straighttalk.bean.Contact;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by dllo on 16/3/2.
 */
public class ContactsRVAdapter extends BaseRVAdapter<Contact> {

    @Override
    public int getItemViewType(int position) {
        return getLists().get(position).getType();
    }


    @Override
    public BaseViewHolder<Contact> onCreateViewHolder(ViewGroup parent, int viewType) {
        BaseViewHolder holder = null;
        if (viewType == 1) {
            holder = new LocalContactsViewHolder(parent.getContext(), parent, getListener());
            return holder;
        }
        holder = new AppContactsViewHolder(parent.getContext(), parent, getListener());
        return holder;
    }


}
